<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 
        var obj = Object.create({
            name: '王俊凯',
            age: 18
        })
        // Object.prototype.height = '178cm';
        console.log(obj);
        console.log(obj.__proto__ === Object.prototype); //false
        console.log(obj.__proto__.__proto__ === Object.prototype); //true
        console.log(Object.prototype)
        // console.log(obj.__proto__ === Function.prototype);

        // console.log(obj.__proto__);
        // var obj1 = {
        //     name: 'lisi'
        // }
        // console.log(obj1.__proto__ === Function.prototype); //false
        // console.log(obj1.__proto__ === Object.prototype); //true

        // var obj1 = Object.create(null, {
        //     name: {
        //         value: '张三',
        //         writable: true,
        //         configurable: true,
        //         enumerable: true
        //     },
        //     age: {
        //         value: 18,
                
        //     }
        // })
        // obj1.name = '李四';
        // obj1.age = 90;
        // console.log(obj1);

        var val = '张三';
        var obj1 = Object.create(null, {
            name: {
                get: function() {
                    console.log('get');
                    return val;
                },
                set: function(newval) {
                    console.log('set');
                    val = newval;
                },
                enumerable: true,
                configurable: true
            },
            age: {
                value: 18,
                writable: true,
                enumerable: true,
                configurable: true
            }
        })
        obj1.name = '李四';
        obj1.age = 90;
        console.log(obj1);
    </script>
</body>
</html>